/******************************************************************************
Purpose: 	

(1) Reproduce tables from main manuscript
	a. 	Table 1: Perceived Numbers of Nonsmokers and Smokers Who Will Get Lung 
		Cancer: SRBI, Harris Interactive, and FFRISP Surveys (p. 15)
	b. 	Table 2: Perceived Attributable Risk of Getting Lung Cancer from 
		Cigarette Smoking: SRBI, Harris Interactive, and FFRISP Surveys (p. 16)
	c. 	Table 3: Perceived Relative Risk of Getting Lung Cancer from Cigarette
		Smoking: SRBI, Harris Interactive, and FFRISP Surveys (p. 17)

*******************************************************************************/

global basepath "..."
* set pathway
global harris "$basepath/harrisxx2.dta"
global srbis "$basepath/srbi renamed vars - weights 8-13-09.dta"

***Table 1
	
	// Distribution of Responses (SRBIS Survey) – Current and Former Smokers
	use "$srbis", clear
	svyset [pw=weight1]
	drop if control~=1
	drop if pwperson<0

		// Out of 1,000 nonsmokers
		gen pq51cats=.
		replace pq51cats=0 if pq51<51 & pq51>=0
		replace pq51cats=1 if pq51<101 & pq51>=51
		replace pq51cats=2 if pq51<151 & pq51>=101
		replace pq51cats=3 if pq51<201 & pq51>=151
		replace pq51cats=4 if pq51<251 & pq51>=201
		replace pq51cats=5 if pq51<301 & pq51>=251
		replace pq51cats=6 if pq51<351 & pq51>=301
		replace pq51cats=7 if pq51<401 & pq51>=351
		replace pq51cats=8 if pq51<451 & pq51>=401
		replace pq51cats=9 if pq51<500 & pq51>=451
		replace pq51cats=10 if pq51==500
		replace pq51cats=11 if pq51<551 & pq51>=501
		replace pq51cats=12 if pq51<601 & pq51>=551
		replace pq51cats=13 if pq51<651 & pq51>=601
		replace pq51cats=14 if pq51<701 & pq51>=651
		replace pq51cats=15 if pq51<751 & pq51>=701
		replace pq51cats=16 if pq51<801 & pq51>=751
		replace pq51cats=17 if pq51<851 & pq51>=801
		replace pq51cats=18 if pq51<901 & pq51>=851
		replace pq51cats=19 if pq51<951 & pq51>=901
		replace pq51cats=20 if pq51<=1000 & pq51>=951

		label define pqcatsl 0 "0-50" 1 "51-100" 2 "101-150" 3 "151-200" 4 "201-250" 5 "251-300" 6 "301-350" 7 "351-400" 8 "401-450" 9 "451-499" 10 "500" 11 "501-550" 12 "551-600" 13 "601-650" 14 "651-700" 15 "701-750" 16 "751-800" 17 "801-850" 18 "851-900" 19 "901-950" 20 "951-1000"
		label values pq51cats pqcatsl

		svy: tab pq51cats
		sum pq51 [aw=weight1], d
	
		// Out of 1,000 smokers
		gen pq52cats=.
		replace pq52cats=0 if pq52<51 & pq52>=0
		replace pq52cats=1 if pq52<101 & pq52>=51
		replace pq52cats=2 if pq52<151 & pq52>=101
		replace pq52cats=3 if pq52<201 & pq52>=151
		replace pq52cats=4 if pq52<251 & pq52>=201
		replace pq52cats=5 if pq52<301 & pq52>=251
		replace pq52cats=6 if pq52<351 & pq52>=301
		replace pq52cats=7 if pq52<401 & pq52>=351
		replace pq52cats=8 if pq52<451 & pq52>=401
		replace pq52cats=9 if pq52<500 & pq52>=451
		replace pq52cats=10 if pq52==500
		replace pq52cats=11 if pq52<551 & pq52>=501 
		replace pq52cats=12 if pq52<601 & pq52>=551
		replace pq52cats=13 if pq52<651 & pq52>=601
		replace pq52cats=14 if pq52<701 & pq52>=651
		replace pq52cats=15 if pq52<751 & pq52>=701
		replace pq52cats=16 if pq52<801 & pq52>=751
		replace pq52cats=17 if pq52<851 & pq52>=801
		replace pq52cats=18 if pq52<901 & pq52>=851
		replace pq52cats=19 if pq52<951 & pq52>=901
		replace pq52cats=20 if pq52<=1000 & pq52>=951
		label values pq52cats pqcatsl

		svy: tab pq52cats 
		sum pq52 [aw=weight1], d
	
	/* Distribution of Responses After Removing Respondents Who Responded 500 
		on Either Risk Perception Question (SRBI Survey) – Current and Former
		Smokers*/
		
		preserve 
		
			drop if pq51==500
			drop if pq52==500
			
			// Out of 1,000 nonsmokers
			svy: tab pq51cats
			sum pq51 [aw=weight1], d

			// Out of 1,000 smoker
			svy: tab pq52cats
			sum pq52 [aw=weight1],d
			
		restore
		
	/*Distribution of Responses After Imputing Risk Perceptions for Respondents
		Who Responded 500 on Either Question (SRBI Survey) – Current and Former
		Smokers*/
		
		// Out of 1,000 nonsmokers
		gen pq51impcats=.
		replace pq51impcats=0 if pq51imp2<51 & pq51imp2>=0
		replace pq51impcats=1 if pq51imp2<101 & pq51imp2>=51
		replace pq51impcats=2 if pq51imp2<151 & pq51imp2>=101
		replace pq51impcats=3 if pq51imp2<201 & pq51imp2>=151
		replace pq51impcats=4 if pq51imp2<251 & pq51imp2>=201
		replace pq51impcats=5 if pq51imp2<301 & pq51imp2>=251
		replace pq51impcats=6 if pq51imp2<351 & pq51imp2>=301
		replace pq51impcats=7 if pq51imp2<401 & pq51imp2>=351
		replace pq51impcats=8 if pq51imp2<451 & pq51imp2>=401
		replace pq51impcats=9 if pq51imp2<500 & pq51imp2>=451
		replace pq51impcats=10 if pq51imp2==500
		replace pq51impcats=11 if pq51imp2<551 & pq51imp2>=501
		replace pq51impcats=12 if pq51imp2<601 & pq51imp2>=551
		replace pq51impcats=13 if pq51imp2<651 & pq51imp2>=601
		replace pq51impcats=14 if pq51imp2<701 & pq51imp2>=651
		replace pq51impcats=15 if pq51imp2<751 & pq51imp2>=701
		replace pq51impcats=16 if pq51imp2<801 & pq51imp2>=751
		replace pq51impcats=17 if pq51imp2<851 & pq51imp2>=801
		replace pq51impcats=18 if pq51imp2<901 & pq51imp2>=851
		replace pq51impcats=19 if pq51imp2<951 & pq51imp2>=901
		replace pq51impcats=20 if pq51imp2<=1000 & pq51imp2>=951

		label values pq51impcats pqcatsl
		svy: tab pq51impcats
		sum pq51imp2 [aw=weight1], d

		// Out of 1,000 smokers
		
		gen pq52impcats=.
		replace pq52impcats=0 if pq52imp2<51 & pq52imp2>=0
		replace pq52impcats=1 if pq52imp2<101 & pq52imp2>=51
		replace pq52impcats=2 if pq52imp2<151 & pq52imp2>=101
		replace pq52impcats=3 if pq52imp2<201 & pq52imp2>=151
		replace pq52impcats=4 if pq52imp2<251 & pq52imp2>=201
		replace pq52impcats=5 if pq52imp2<301 & pq52imp2>=251
		replace pq52impcats=6 if pq52imp2<351 & pq52imp2>=301
		replace pq52impcats=7 if pq52imp2<401 & pq52imp2>=351
		replace pq52impcats=8 if pq52imp2<451 & pq52imp2>=401
		replace pq52impcats=9 if pq52imp2<500 & pq52imp2>=451
		replace pq52impcats=10 if pq52imp2==500
		replace pq52impcats=11 if pq52imp2<551 & pq52imp2>=501
		replace pq52impcats=12 if pq52imp2<601 & pq52imp2>=551
		replace pq52impcats=13 if pq52imp2<651 & pq52imp2>=601
		replace pq52impcats=14 if pq52imp2<701 & pq52imp2>=651
		replace pq52impcats=15 if pq52imp2<751 & pq52imp2>=701
		replace pq52impcats=16 if pq52imp2<801 & pq52imp2>=751
		replace pq52impcats=17 if pq52imp2<851 & pq52imp2>=801
		replace pq52impcats=18 if pq52imp2<901 & pq52imp2>=851
		replace pq52impcats=19 if pq52imp2<951 & pq52imp2>=901
		replace pq52impcats=20 if pq52imp2<=1000 & pq52imp2>=951

		label values pq52impcats pqcatsl

		svy: tab pq52impcats
		sum pq52imp2 [aw=weight1], d
		
	/*Distribution of Responses (Harris Interactive Survey) – Current and Former
		Smokers*/
		
	use "$harris", clear
	svyset [pw=weight1]
	drop if control~=1
		
		// Out of 1,000 nonsmokers
		gen pq51cats=.
		replace pq51cats=0 if q2060_<51 & q2060_>=0
		replace pq51cats=1 if q2060_<101 & q2060_>=51
		replace pq51cats=2 if q2060_<151 & q2060_>=101
		replace pq51cats=3 if q2060_<201 & q2060_>=151
		replace pq51cats=4 if q2060_<251 & q2060_>=201
		replace pq51cats=5 if q2060_<301 & q2060_>=251
		replace pq51cats=6 if q2060_<351 & q2060_>=301
		replace pq51cats=7 if q2060_<401 & q2060_>=351
		replace pq51cats=8 if q2060_<451 & q2060_>=401
		replace pq51cats=9 if q2060_<500 & q2060_>=451
		replace pq51cats=10 if q2060_==500
		replace pq51cats=11 if q2060_<551 & q2060_>=501
		replace pq51cats=12 if q2060_<601 & q2060_>=551
		replace pq51cats=13 if q2060_<651 & q2060_>=601
		replace pq51cats=14 if q2060_<701 & q2060_>=651
		replace pq51cats=15 if q2060_<751 & q2060_>=701
		replace pq51cats=16 if q2060_<801 & q2060_>=751
		replace pq51cats=17 if q2060_<851 & q2060_>=801
		replace pq51cats=18 if q2060_<901 & q2060_>=851
		replace pq51cats=19 if q2060_<951 & q2060_>=901
		replace pq51cats=20 if q2060_<=1000 & q2060_>=951

		label define pqcatsl 0 "0-50" 1 "51-100" 2 "101-150" 3 "151-200" 4 "201-250" 5 "251-300" 6 "301-350" 7 "351-400" 8 "401-450" 9 "451-499" 10 "500" 11 "501-550" 12 "551-600" 13 "601-650" 14 "651-700" 15 "701-750" 16 "751-800" 17 "801-850" 18 "851-900" 19 "901-950" 20 "951-1000"
		label values pq51cats pqcatsl

		svy: tab pq51cats

		sum q2060_ [aw=weight1], d
	
		// Out of 1,000 smokers
		gen pq52cats=.
		replace pq52cats=0 if q2062_<51 & q2062_>=0
		replace pq52cats=1 if q2062_<101 & q2062_>=51
		replace pq52cats=2 if q2062_<151 & q2062_>=101
		replace pq52cats=3 if q2062_<201 & q2062_>=151
		replace pq52cats=4 if q2062_<251 & q2062_>=201
		replace pq52cats=5 if q2062_<301 & q2062_>=251
		replace pq52cats=6 if q2062_<351 & q2062_>=301
		replace pq52cats=7 if q2062_<401 & q2062_>=351
		replace pq52cats=8 if q2062_<451 & q2062_>=401
		replace pq52cats=9 if q2062_<500 & q2062_>=451
		replace pq52cats=10 if q2062_==500
		replace pq52cats=11 if q2062_<551 & q2062_>=501
		replace pq52cats=12 if q2062_<601 & q2062_>=551
		replace pq52cats=13 if q2062_<651 & q2062_>=601
		replace pq52cats=14 if q2062_<701 & q2062_>=651
		replace pq52cats=15 if q2062_<751 & q2062_>=701
		replace pq52cats=16 if q2062_<801 & q2062_>=751
		replace pq52cats=17 if q2062_<851 & q2062_>=801
		replace pq52cats=18 if q2062_<901 & q2062_>=851
		replace pq52cats=19 if q2062_<951 & q2062_>=901
		replace pq52cats=20 if q2062_<=1000 & q2062_>=951
		label values pq52cats pqcatsl

		svy: tab pq52cats
		sum q2062_ [aw=weight1], d
		
***Table 2: Attributable Risk 

	// Distribution of Responses (SRBIS Survey) – Current and Former Smokers
	use "$srbis", clear
	svyset [pw=weight1]
	drop if control~=1
	drop if pwperson<0
	
		// Valid percent
		gen rdcats=.
		replace rdcats=0 if rd<0
		replace rdcats=1 if rd==0
		replace rdcats=2 if rd<50 & rd>0
		replace rdcats=3 if rd<100 & rd>=50
		replace rdcats=4 if rd<150 & rd>=100
		replace rdcats=5 if rd<200 & rd>=150
		replace rdcats=6 if rd<250 & rd>=200
		replace rdcats=7 if rd<300 & rd>=250
		replace rdcats=8 if rd<350 & rd>=300
		replace rdcats=9 if rd<400 & rd>=350
		replace rdcats=10 if rd<450 & rd>=400
		replace rdcats=11 if rd<500 & rd>=450
		replace rdcats=12 if rd==500
		replace rdcats=13 if rd<550 & rd>500
		replace rdcats=14 if rd<600 & rd>=550
		replace rdcats=15 if rd<650 & rd>=600
		replace rdcats=16 if rd<700 & rd>=650
		replace rdcats=17 if rd<750 & rd>=700
		replace rdcats=18 if rd<800 & rd>=750
		replace rdcats=19 if rd<850 & rd>=800
		replace rdcats=20 if rd<900 & rd>=850
		replace rdcats=21 if rd<950 & rd>=900
		replace rdcats=22 if rd<=1000 & rd>=950

		label define rdcatsl 0 "-1000 to -1" 1 "0" 2 "1-49" 3 "50-99" 4 "100-149" 5 "150-199" 6 "200-249" 7 "250-299" 8 "300-349" 9 "350-399" 10 "400-449" 11 "450-499" 12 "500" 13 "501-549" 14 "550-599" 15 "600-649" 16 "650-699" 17 "700-749" 18 "750-799" 19 "800-849" 20 "850-899" 21 "900-949" 22 "950-1,000"
		label values rdcats rdcatsl

		svy: tab rdcats
		
		// Cumulative percent 
		
		tab rdcats [aw=weight1]
		sum rd [aw=weight1], d

	
	/* Distribution of Responses After Removing Respondents Who Responded 500 
		on Either Risk Perception Question (SRBI Survey) – Current and Former
		Smokers*/ 
		preserve 
		
			drop if pq51==500
			drop if pq52==500
		
			// Valid percent
			gen rdclone=.
			replace rdclone=pq52-pq51

			gen rdcatsclone=.
			replace rdcatsclone=0 if rdclone<0
			replace rdcatsclone=1 if rdclone==0
			replace rdcatsclone=2 if rdclone<50 & rdclone>0
			replace rdcatsclone=3 if rdclone<100 & rdclone>=50
			replace rdcatsclone=4 if rdclone<150 & rdclone>=100
			replace rdcatsclone=5 if rdclone<200 & rdclone>=150
			replace rdcatsclone=6 if rdclone<250 & rdclone>=200
			replace rdcatsclone=7 if rdclone<300 & rdclone>=250
			replace rdcatsclone=8 if rdclone<350 & rdclone>=300
			replace rdcatsclone=9 if rdclone<400 & rdclone>=350
			replace rdcatsclone=10 if rdclone<450 & rdclone>=400
			replace rdcatsclone=11 if rdclone<500 & rdclone>=450
			replace rdcatsclone=12 if rdclone==500
			replace rdcatsclone=13 if rdclone<550 & rdclone>500
			replace rdcatsclone=14 if rdclone<600 & rdclone>=550
			replace rdcatsclone=15 if rdclone<650 & rdclone>=600
			replace rdcatsclone=16 if rdclone<700 & rdclone>=650
			replace rdcatsclone=17 if rdclone<750 & rdclone>=700
			replace rdcatsclone=18 if rdclone<800 & rdclone>=750
			replace rdcatsclone=19 if rdclone<850 & rdclone>=800
			replace rdcatsclone=20 if rdclone<900 & rdclone>=850
			replace rdcatsclone=21 if rdclone<950 & rdclone>=900
			replace rdcatsclone=22 if rdclone<=1000 & rdclone>=950
			label values rdcatsclone rdcatsl

			svy: tab rdcatsclone
			
			// Cumulative percent 
			tab rdcatsclone [aw=weight1]
			sum rdclone [aw=weight1], d

		restore
		
	/*Distribution of Responses After Imputing Risk Perceptions for Respondents
		Who Responded 500 on Either Question (SRBI Survey) – Current and Former
		Smokers*/
		
		// Valid percent
		gen rdimpcats=.
		replace rdimpcats=0 if rdimp<0
		replace rdimpcats=1 if rdimp==0
		replace rdimpcats=2 if rdimp<50 & rdimp>0
		replace rdimpcats=3 if rdimp<100 & rdimp>=50
		replace rdimpcats=4 if rdimp<150 & rdimp>=100
		replace rdimpcats=5 if rdimp<200 & rdimp>=150
		replace rdimpcats=6 if rdimp<250 & rdimp>=200
		replace rdimpcats=7 if rdimp<300 & rdimp>=250
		replace rdimpcats=8 if rdimp<350 & rdimp>=300
		replace rdimpcats=9 if rdimp<400 & rdimp>=350
		replace rdimpcats=10 if rdimp<450 & rdimp>=400
		replace rdimpcats=11 if rdimp<500 & rdimp>=450
		replace rdimpcats=12 if rdimp==500
		replace rdimpcats=13 if rdimp<550 & rdimp>500
		replace rdimpcats=14 if rdimp<600 & rdimp>=550
		replace rdimpcats=15 if rdimp<650 & rdimp>=600
		replace rdimpcats=16 if rdimp<700 & rdimp>=650
		replace rdimpcats=17 if rdimp<750 & rdimp>=700
		replace rdimpcats=18 if rdimp<800 & rdimp>=750
		replace rdimpcats=19 if rdimp<850 & rdimp>=800
		replace rdimpcats=20 if rdimp<900 & rdimp>=850
		replace rdimpcats=21 if rdimp<950 & rdimp>=900
		replace rdimpcats=22 if rdimp<=1000 & rdimp>=950
		label values rdimpcats rdcatsl

		svy: tab rdimpcats
		
		// Cumulative percent 
		tab rdimpcats [aw=weight1]
		sum rdimp [aw=weight1], d
		
	/*Distribution of Responses (Harris Interactive Survey) – Current and Former
		Smokers*/
		
	use "$harris", clear
	svyset [pw=weight1]
	drop if control~=1
		
		// Valid percent
		gen rdcats=.
		replace rdcats=0 if rd<0
		replace rdcats=1 if rd==0
		replace rdcats=2 if rd<50 & rd>0
		replace rdcats=3 if rd<100 & rd>=50
		replace rdcats=4 if rd<150 & rd>=100
		replace rdcats=5 if rd<200 & rd>=150
		replace rdcats=6 if rd<250 & rd>=200
		replace rdcats=7 if rd<300 & rd>=250
		replace rdcats=8 if rd<350 & rd>=300
		replace rdcats=9 if rd<400 & rd>=350
		replace rdcats=10 if rd<450 & rd>=400
		replace rdcats=11 if rd<500 & rd>=450
		replace rdcats=12 if rd==500
		replace rdcats=13 if rd<550 & rd>500
		replace rdcats=14 if rd<600 & rd>=550
		replace rdcats=15 if rd<650 & rd>=600
		replace rdcats=16 if rd<700 & rd>=650
		replace rdcats=17 if rd<750 & rd>=700
		replace rdcats=18 if rd<800 & rd>=750
		replace rdcats=19 if rd<850 & rd>=800
		replace rdcats=20 if rd<900 & rd>=850
		replace rdcats=21 if rd<950 & rd>=900
		replace rdcats=22 if rd<=1000 & rd>=950

		label define rdcatsl 0 "-1000 to -1" 1 "0" 2 "1-49" 3 "50-99" 4 "100-149" 5 "150-199" 6 "200-249" 7 "250-299" 8 "300-349" 9 "350-399" 10 "400-449" 11 "450-499" 12 "500" 13 "501-549" 14 "550-599" 15 "600-649" 16 "650-699" 17 "700-749" 18 "750-799" 19 "800-849" 20 "850-899" 21 "900-949" 22 "950-1,000"
		label values rdcats rdcatsl
		svy: tab rdcats
		
		// Cumulative percent 
		tab rdcats [aw=weight1]
		sum rd [aw=weight1], d


***Table 3: Relative Risk 

	// Distribution of Responses (SRBIS Survey) – Current and Former Smokers
	use "$srbis", clear
	svyset [pw=weight1]
	drop if control~=1
	drop if pwperson<0
	
		// Valid percent	
		gen rrcats=.
		replace rrcats=0 if rrx<1
		replace rrcats=1 if rrx==1
		replace rrcats=2 if rrx<2 & rrx>1
		replace rrcats=3 if rrx<3 & rrx>=2
		replace rrcats=4 if rrx<4 & rrx>=3
		replace rrcats=5 if rrx<5 & rrx>=4
		replace rrcats=6 if rrx<6 & rrx>=5
		replace rrcats=7 if rrx<7 & rrx>=6
		replace rrcats=8 if rrx<8 & rrx>=7
		replace rrcats=9 if rrx<9 & rrx>=8
		replace rrcats=10 if rrx<10 & rrx>=9
		replace rrcats=11 if rrx<11 & rrx>=10
		replace rrcats=12 if rrx<12 & rrx>=11
		replace rrcats=13 if rrx<13 & rrx>=12
		replace rrcats=14 if rrx<14 & rrx>=13
		replace rrcats=15 if rrx<15 & rrx>=14
		replace rrcats=16 if rrx<16 & rrx>=15
		replace rrcats=17 if rrx<17 & rrx>=16
		replace rrcats=18 if rrx<18 & rrx>=17
		replace rrcats=19 if rrx<19 & rrx>=18
		replace rrcats=20 if rrx<20 & rrx>=19
		replace rrcats=21 if rrx<30 & rrx>=20
		replace rrcats=22 if rrx<50 & rrx>=30
		replace rrcats=23 if rrx<80 & rrx>=50
		replace rrcats=24 if rrx<=1001 & rrx>=80

		label define rrcatsl 0 "0 to .99" 1 "1" 2 "1.01-1.99" 3 "2.00-2.99" 4 "3.00-3.99" 5 "4.00-4.99" 6 "5.00-5.99" 7 "6.00-6.99" 8 "7.00-7.99" 9 "8.00-8.99" 10 "9.00-9.99" 11 "10.00-10.99" 12 "11.00-11.99" 13 "12.00-12.99" 14 "13.00-13.99" 15 "14.00-14.99" 16 "15.00-15.99" 17 "16.00-16.99" 18 "17.00-17.99" 19 "18.00-18.99" 20 "19.00-19.99" 21 "20.00-29.99" 22 "30.00-49.99" 23 "50.00-79.99" 24 "80.00-1,001.00"
		label values rrcats rrcatsl

		svy: tab rrcats
		
		// Cumulative percent 
		
		tab rrcats [aw=weight1]
		sum rrx [aw=weight1], d
		
	/* Distribution of Responses After Removing Respondents Who Responded 500 
		on Either Risk Perception Question (SRBI Survey) – Current and Former
		Smokers*/ 
		
		tab rrcats [aw=weight1] if pq51!=500&pq52!=500
		sum rrx [aw=weight1] if pq51!=500&pq52!=500, d
			
	/*Distribution of Responses After Imputing Risk Perceptions for Respondents
		Who Responded 500 on Either Question (SRBI Survey) – Current and Former
		Smokers*/

		// Valid percent
		gen pq51imp3 = pq51imp2+1
		gen pq52imp3 = pq52imp2+1
		gen rrimpnew = pq52imp3/pq51imp3

		gen rrimpcats=.
		replace rrimpcats=0 if rrimpnew<1 & rrimpnew>=0
		replace rrimpcats=1 if rrimpnew==1
		replace rrimpcats=2 if rrimpnew<2 & rrimpnew>1
		replace rrimpcats=3 if rrimpnew<3 & rrimpnew>=2
		replace rrimpcats=4 if rrimpnew<4 & rrimpnew>=3
		replace rrimpcats=5 if rrimpnew<5 & rrimpnew>=4
		replace rrimpcats=6 if rrimpnew<6 & rrimpnew>=5
		replace rrimpcats=7 if rrimpnew<7 & rrimpnew>=6
		replace rrimpcats=8 if rrimpnew<8 & rrimpnew>=7
		replace rrimpcats=9 if rrimpnew<9 & rrimpnew>=8
		replace rrimpcats=10 if rrimpnew<10 & rrimpnew>=9
		replace rrimpcats=11 if rrimpnew<11 & rrimpnew>=10
		replace rrimpcats=12 if rrimpnew<12 & rrimpnew>=11
		replace rrimpcats=13 if rrimpnew<13 & rrimpnew>=12
		replace rrimpcats=14 if rrimpnew<14 & rrimpnew>=13
		replace rrimpcats=15 if rrimpnew<15 & rrimpnew>=14
		replace rrimpcats=16 if rrimpnew<16 & rrimpnew>=15
		replace rrimpcats=17 if rrimpnew<17 & rrimpnew>=16
		replace rrimpcats=18 if rrimpnew<18 & rrimpnew>=17
		replace rrimpcats=19 if rrimpnew<19 & rrimpnew>=18
		replace rrimpcats=20 if rrimpnew<20 & rrimpnew>=19
		replace rrimpcats=21 if rrimp<30 & rrimpnew>=20
		replace rrimpcats=22 if rrimpnew<50 & rrimpnew>=30
		replace rrimpcats=23 if rrimpnew<80 & rrimpnew>=50
		replace rrimpcats=24 if rrimpnew<=1001 & rrimpnew>=80

		label values rrimpcats rrcatsl

		svy: tab rrimpcats
		
		// Cumulative percent 
		tab rrimpcats [aw=weight1]
		sum rrimpnew [aw=weight1], d
		
	/*Distribution of Responses (Harris Interactive Survey) – Current and Former
		Smokers*/
	
	use "$harris", clear
	svyset [pw=weight1]
	drop if control~=1
	
		// Valid percent
		gen q2060_new = q2060_+1
		gen q2062_new = q2062_+1

		gen rrx=.
		replace rrx=q2062_new/q2060_new
		
		gen rrcats=.
		replace rrcats=0 if rrx<1
		replace rrcats=1 if rrx==1
		replace rrcats=2 if rrx<2 & rrx>1
		replace rrcats=3 if rrx<3 & rrx>=2
		replace rrcats=4 if rrx<4 & rrx>=3
		replace rrcats=5 if rrx<5 & rrx>=4
		replace rrcats=6 if rrx<6 & rrx>=5
		replace rrcats=7 if rrx<7 & rrx>=6
		replace rrcats=8 if rrx<8 & rrx>=7
		replace rrcats=9 if rrx<9 & rrx>=8
		replace rrcats=10 if rrx<10 & rrx>=9
		replace rrcats=11 if rrx<11 & rrx>=10
		replace rrcats=12 if rrx<12 & rrx>=11
		replace rrcats=13 if rrx<13 & rrx>=12
		replace rrcats=14 if rrx<14 & rrx>=13
		replace rrcats=15 if rrx<15 & rrx>=14
		replace rrcats=16 if rrx<16 & rrx>=15
		replace rrcats=17 if rrx<17 & rrx>=16
		replace rrcats=18 if rrx<18 & rrx>=17
		replace rrcats=19 if rrx<19 & rrx>=18
		replace rrcats=20 if rrx<20 & rrx>=19
		replace rrcats=21 if rrx<30 & rrx>=20
		replace rrcats=22 if rrx<50 & rrx>=30
		replace rrcats=23 if rrx<80 & rrx>=50
		replace rrcats=24 if rrx<=1001 & rrx>=80

		label define rrcatsl 0 "0 to .99" 1 "1" 2 "1.01-1.99" 3 "2.00-2.99" 4 "3.00-3.99" 5 "4.00-4.99" 6 "5.00-5.99" 7 "6.00-6.99" 8 "7.00-7.99" 9 "8.00-8.99" 10 "9.00-9.99" 11 "10.00-10.99" 12 "11.00-11.99" 13 "12.00-12.99" 14 "13.00-13.99" 15 "14.00-14.99" 16 "15.00-15.99" 17 "16.00-16.99" 18 "17.00-17.99" 19 "18.00-18.99" 20 "19.00-19.99" 21 "20.00-29.99" 22 "30.00-49.99" 23 "50.00-79.99" 24 "80.00-1,001.00"
		label values rrcats rrcatsl
		svy: tab rrcats

		// Cumulative percent 
		tab rrcats [aw=weight1]
		sum rrx [aw=weight1], d	
		

